Javascript Packer
Published 2010-08-11 00:00:00
Javascript packer in Javascript, with full scoped variable replacement
Source:
git clone http://git.roojs.org/gnome.introspection-doc-generator
http://git.roojs.org/?p=gnome.introspection-doc-generator;a=tree
Usage Example:
seed pack.js -o /compressed/combined.js *.js
Example Output:
http://www.akbkhome.com/roojs1/roojs-ui.jsUsage
seed pack.js [OPTIONS] LIST_OF_FILES
-o FILENAME
File to output compressed javascript
-O FILENAME
File to output non-compressed file name
-w DIRECTORY
Cache directory (writes minified files in here)
-C
do not clean up cache directory
-f DEPENDANCY FILE
File to read with a list of source paths / or class names.
-p STRING
prefix for translation md5 generator (directory that files are in, and is removed) from path when generating an md5 for the translated name.
-k
keeps the white space in the output files (but does variable replacement).
-t
generate a translation file using double quoted strings
-a
autoBuild - puts target in INPUTDIR/compiled/MODULE-TIMESTAMP.js and turns on translation
code.
-m STRING
module name used with autoBuild to force a module name.
LIST_OF_FILES
files to be compressed.
Notes
This is part of the Javascript toolkit for seed which also includes JSDOC documentation toolkit and API documentation for Gnome seed bindings.Design
Loosely based off the Yahoo Compressor Java library, using the JSToolkit tokenizer code. Since I hate running Java anywhere, this is a pure Javascript solution, which in theory could be turned into an online version..It's used primarily for the Roo javascript library building and my Pman Project components.
Performance is acceptable, I've never run any of the other compressors, but it takes around 30 seconds to do the ~170 Javascript files in Roo javascript library.
One key change that's been done is the use of a token tree which makes scope detection considerably simpler.
Recent changes include flagging IE trailing comma detection
Mentioned By:
google.com : javascript packer (153 referals)
google.com : 1332 (11 referals)
twitter.com : (7 referals)
google.com : packer javascript (6 referals)
blog.astrumfutura.com : HTML Sanitisation: The Devil's In The Details (And The Vulnerabilities) - Maugrim The Reaper's Blog (5 referals)
www.phpavancado.net : PHPAvançado | PHP avançado para programadores avançados! (2 referals)
planet-php.org : Planet PHP (2 referals)
mobile.twitter.com : Twitter (2 referals)
google.com : javascript bk library (2 referals)
blog.astrumfutura.com : Maugrim The Reaper's Blog (2 referals)
planet-php.org : Planet PHP (1 referals)
google.com : app (1 referals)
google.com : javascript packer (153 referals)
google.com : 1332 (11 referals)
twitter.com : (7 referals)
google.com : packer javascript (6 referals)
blog.astrumfutura.com : HTML Sanitisation: The Devil's In The Details (And The Vulnerabilities) - Maugrim The Reaper's Blog (5 referals)
www.phpavancado.net : PHPAvançado | PHP avançado para programadores avançados! (2 referals)
planet-php.org : Planet PHP (2 referals)
mobile.twitter.com : Twitter (2 referals)
google.com : javascript bk library (2 referals)
blog.astrumfutura.com : Maugrim The Reaper's Blog (2 referals)
planet-php.org : Planet PHP (1 referals)
google.com : app (1 referals)
Follow us
-
- Some thoughts on the language server and its usefulness in the roobuilder
- Roo Builder for Gtk4 moving forward
- Clustered Web Applications - Mysql and File replication
- GitLive - Branching - Merging
- PDO_DataObject Released
- PDO_DataObject is under way
- Mass email Marketing and anti-spam - some of the how-to..
- Hydra - Recruitment done right
Blog Latest
-
Twitter - @Roojs